The present invention relates to a numerical control unit, and in particular to a numerically controlled machine tool which enables more efficient positioning of an interchangeable tool at a tool changing position.
FIG. 8, which is a block diagram of positioning apparatus for achieving a tool changing position in a known numerical control unit, shows a machining program 1, a reader 2 for reading a machining program 1, a key input device 3 for entering a machining program from its keyboard, a machining program editor 4 for writing the machining program in accordance with data entered from the keyboard, a machining program file 5 for storing the machining program written by the machining program reader 2 or the machining program editor 4, a one-block reader 6 for extracting and reading one block from the machining program, a command analyzer 7 for interpreting the command in the block and performing processing such as an operation in accordance with that command, a move command generator 8 for defining the travel of each control axis in accordance with the results of the command analyzer 7, a drive controller 9 for converting a move command into an electrical signal, and a servo motor 10 for driving each control axis. A current position storing device 11 accumulates a current position updated and managed by the move command generating device 8. A key input device 12 enters data such as a tool length. A tool data memory 13 accumulates data such as tool length. A key input device 14 teaches a tool changing position. A tool changing position defining device 15 defines the tool changing position in accordance with the tool data stored in the tool data memory 13 and a teaching command provided by the key input device 14, and a tool changing position memory 16 accumulates the defined tool changing position.
FIG. 9 illustrates relationships among a workpiece, a machine tool and a tool, including a chuck 87 of the machine tool for gripping a workpiece 86, and a tool rest 85 of the machine tool, movable in Z-axis and X-axis directions, and rotatable for making a tool change. First to fourth tools 81-84 are installed in tool rest 85 and are assigned respective tool numbers T00. "A" indicates a reference point, and "B" a current position at the time of teaching, as contained in the current position memory 11 and located a distance AX.sub.T from the reference point A. "C" indicates a tool changing position stored in the tool changing position memory 16 and located a vertical distance TC away from the reference point A.
Operation will now be described with reference to FIGS. 8 and 9. Lengths TL1 to TL4 of the tools 81 to 84 mounted on the tool rest 85 are registered beforehand in the tool data memory 13 from the key input device 12 in correspondence with the tool numbers. After selecting any tool, the tool is positioned manually to a tool changing position where the tool does not interfere with the workpiece 86, the machine chuck 87 and the like, using a jogging function or the like intrinsic to the machine tool. Then, the numerical control unit is taught the tool changing position using the key input device 14. The tool changing position defining device 15 extracts the length TL.sub.N of the tool 81 currently selected, and also the maximum tool length TL.sub.MAX among those of the registered tools from the tool data memory 13. The defining device 15 then extracts the teaching-time current position B from the current position storing device 11, obtains the tool changing position C according to the expression TC=AX.sub.T -(TL.sub.MAX -TL.sub.N), and stores the result into the tool changing position memory 16.
When automatic operation is to be performed, one program block is fetched by the one-block reader 6 from the machining program stored in the machining program file 5. The command analyzer 7 interprets the one block, extracts the coordinates of the tool changing position C from the tool changing position memory 16 if a tool positioning command (e.g., G24, G25, G26, G27) exists in that one block, or generates the positioning command for the tool changing position C.
The move command generator 8 obtains the amount of travel in accordance with the current position in the current position memory 11 and the target end-point position, i.e., tool changing position C, and gives it to the drive controller 9 as a move command. The drive controller 9 converts the position command into an electrical signal to drive the servo motor 10, and runs the servo motor 10 until the target end-point position, i.e., tool changing position C, is reached, to complete positioning to the tool changing position C.
In the known numerical control unit configured as described above, the tool changing position C is a fixed position defined in accordance with the longest tool 84 and the teaching-time workpiece state. This may cause the tool changing position C to be located further away from the workpiece 86 than required, which results in a disadvantage of longer overall machining time. It is desirable to reduce the machining time by making the tool changing position C variable to provide the optimum tool changing position.
FIG. 4 shows machining in which point E indicates a non-interfering tool changing position before machining (the workpiece is indicated by a continuous line), which is defined by the conventional numerical control unit, and point D indicates a non-interfering optimum tool changing position after some machining has been performed (the workpiece is indicated by a broken line). Thus, the tool need not move as far to be in a safe tool changing position. It would be desirable to be able to change the tool at a closer tool changing position, to save time.